*. Sticky notes


There's surprisingly little Japanese text - around 6 strings to handle the creation
of OS system disks. Interesting for those with the real computer.

Freely mix ASCII with SJIS.

But it's LZ-compressed. In a wickedly large routine with too many optimization paths.
So we've got to explore a bypass.

; -----------------------

Adding extra code to the end of a '.X' program does not work. Usually it gets bashed by
data variables or system-relocatable pointers.

Only non PTR-32 code can be used. The decoder has stable space (LZ copying area).
So we place our disk loading code there (~192 bytes). This is basically template code
that can be recycled.

Catch is that we have to save RAM pointers since the code is relocatable. Always changing
locations and not fixed.

$1fe000-1fffff looks to be the unused area. We use the last $1000 bytes for our own stack
and custom code/data. Using the game's old stack area is VERY FIXED-LIMIT. Too limited for
our purposes.

At the end, we have to replace the original code and place in our bypass/slipstreamer.
It is complex.

; -----------------------

Our slipstreamer copies 32-bit pointers to the original target area (fixed area). Being
a .X code file, we have to adjust our pointers for relocatable + header (see Atlas file).

Since this is done at disk bootup, you'll have to save state very early when the disk is
inserted (for testing this code). If you do it too late, you'll get some invisible loading
errors usually resulting from incomplete data loaded to RAM via BIOS (disk changes).

; -----------------------

You must run the 'insert ASM' first. This sets up the pointers for slipstreaming.
Then you can 'insert TEXT'. This replaces selective pointers.

snasm was used for 68k since SEKAS (Twilight Translations 68k xkas-style assembler) is not
available.

; ============================================================================
; ############################################################################
; ============================================================================

Atlas 1.06 is modified (nothing new since 'Super Robot Wars EX')

> #FILL( int stop_address, int file_byte )		- pads up to stop address
  #FILL( int start, stop, int file_byte )		- pads address range
  #FILL( int start, stop, int file_byte, string file )	- pads address range IN FILE

  #WARN( int warn_address )				- OKAY/BARF if PC counter >= warn_address

  #SAVEPC( string file_name )				- writes PC to file
  #LOADPC( string file_name )				- loads PC from file

  #INSERT( string file_name )				- inserts binary file at current PC

  MSB16,MSB24,MSB32,GB4xxx				- addressing modes

  #SETINDEX( int index_number, int size )		- init the index numbers
  #WRITEINDEX( int address, int index_bump )		- writes index numbers to address, # bytes
							  and auto-bumps the index #
  #WRITEINDEX( int addr, int index_bump, string file )	- writes index number to address IN FILE

  #SAVEINDEX( string file_name )			- writes INDEX # to file
  #LOADINDEX( string file_name )			- loads INDEX # from file

  #ALIGN( int byte_count )                      	- does file alignment (1,2,3,4)

  #W08BYTE( int address, int byte )			- writes byte to address (no JMP)
  #W08BYTE( int addr, int byte, string file )		- writes byte to address IN FILE (no JMP)

  #EMBCLEAR()						- erases all embedded pointers

  #SAVEPTRTABLE( PTRTABLE table, string file_name )	- writes PTRTABLE address to file
  #LOADPTRTABLE( PTRTABLE table, string file_name )	- loads PTRTABLE address from file 

  #WRITEOFS( PTRTABLE table, int offset )		- writes POINTER at an offset amount (from the table start)
